// 模态框组件模板
const modalTemplate = `
<div class="modal" id="toolModal">
    <div class="modal-content">
        <div class="modal-header">
            <h2 id="modalTitle"></h2>
            <button class="close-btn" onclick="closeModal()">
                <i class="ri-close-line"></i>
            </button>
        </div>
        <div class="modal-body" id="modalBody">
            <!-- 动态加载工具内容 -->
        </div>
    </div>
</div>
`;

// 渲染模态框组件
document.getElementById('modalComponent').innerHTML = modalTemplate;

// 打开模态框
function openModal(title, content) {
    const modal = document.getElementById('toolModal');
    const modalTitle = document.getElementById('modalTitle');
    const modalBody = document.getElementById('modalBody');
    
    modalTitle.innerHTML = title;
    modalBody.innerHTML = content;
    modal.style.display = 'block';
}

// 关闭模态框
function closeModal() {
    const modal = document.getElementById('toolModal');
    modal.style.display = 'none';
} 